package goods;

import java.sql.*;
import java.io.*;
import java.util.*;

import common.db.*;
import common.main.*;

public class GoodsBestListBean extends MainBean
{
	public void funcExecute() throws Exception
	{
		String pri1 = (String)inputTable.get("pri1");
		String pri2 = (String)inputTable.get("pri2");
		String price ="";
		if (pri1!=null)
		{
			price ="AND a.GOODS_PRICE BETWEEN "+pri1+" AND "+pri2;
		}
		
		
		queryBuffer = new StringBuffer("");
		queryBuffer.append("SELECT a.GCODE, a.GNAME, a.PURCHARSE_WAY, a.STOCK_VALUE, a.COST, a.GOODS_PRICE, a.SAVING_POINT, a.MK_DATE, a.EX_DATE, a.SE_DATE, a.TE_DATE, a.SELL_CNT, a.REG_ID, a.REG_DATE, a.REG_IP, a.UPD_ID, a.UPD_DATE, a.UPD_IP, b.IMG_PATH, b.OR_N  FROM GOODS a, GOODS_IMG b WHERE a.GCODE=b.GCODE_SEQ AND a.USE_YN='Y' " +price+ " ORDER BY a.SELL_CNT DESC");

		DBExecute dbe = new DBExecute(queryBuffer.toString());
		outputList = dbe.getDataList();
	}
}